﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DownloadBook {
    /// <summary>
    /// 合并配置
    /// </summary>
    public class MergeConfig {
        private string m_HostName;
        private string m_RegContent;
        private int m_RegContentGroupId;
        private string m_RegRemove;

        /// <summary>
        /// 域名
        /// </summary>
        public string hostName {
            get { return m_HostName;  }
            set {
                if(m_HostName != value) {
                    m_HostName = value;
                    isDicty = true;
                }
            }
        }

        /// <summary>
        /// 提取章节内容正则表达式
        /// </summary>
        public string regContent {
            get { return m_RegContent; }
            set {
                if (m_RegContent != value) {
                    m_RegContent = value;
                    isDicty = true;
                }
            }
        }

        /// <summary>
        /// 提取章节内容正则表达式分组Id
        /// </summary>
        public int regContentGroupId {
            get { return m_RegContentGroupId; }
            set {
                if(m_RegContentGroupId != value) {
                    m_RegContentGroupId = value;
                    isDicty = true;
                }
            }
        }

        /// <summary>
        /// 移除内容正则表达式
        /// </summary>
        public string regRemove {
            get { return m_RegRemove; }
            set {
                if(m_RegRemove != value) {
                    m_RegRemove = value;
                    isDicty = true;
                }
            }
        }

        /// <summary>
        /// 是否为脏配置
        /// </summary>
        [JsonIgnore]
        public bool isDicty { get; set; }


        public override String ToString(){
            return hostName;
        }
    }
}
